<template>
  <div class="detail-box-content">
    <h1>{{newsList.title}}</h1>
    <div class="text">{{newsList.content}}</div>
    <div class="time">{{newsList.createTime}}</div>
  </div>
</template>
<script>
import { reactive, computed, onMounted, ref } from 'vue'
import { useStore } from "vuex";
import { useRouter } from "vue-router"
import { Toast } from 'vant';
import { NoticeInfo } from "@/api/public";
export default {

  setup() {
    const store = useStore();
    const router = useRouter()
    const user_info = computed(() => {
      return store.getters.user_info
    })
    const newsList = ref([])

    onMounted(() => {
      const data = { id: router.currentRoute.value.query.id }
      NoticeInfo(data).then(res => {
        newsList.value = res.data.data
      })
    })
    const formData = reactive({


    })
    const goMore = (id) => {
      router.push({
        path: '/me/newsInfo',
        query: {
          id: id
        }
      })
    }
    return {
      formData,
      newsList,
      goMore
    }
  }
}
</script>
<style lang="less" scoped>
.detail-box-content {
  margin: 0 auto;
  margin: 30px 30px;
  background: #282a2c;
  border-radius: 20px;
  padding: 20px;
  h1 {
    text-align: center;
    font-size: 34px;
    font-weight: normal;
    color: #fff;
  }
  .text {
    max-height: 60vh;
    overflow-y: scroll;
    color: #fff;
    font-size: 26px;
    line-height: 0.6rem;
    padding: 3%;
    text-indent: 0.6rem;
  }
  .time {
    color: #fff;
    text-align: right;
  }
}
</style>